define(['app'], function(app) {
	'use strict';

	//实例化方法
	var factory = function(Http) {
		//返回信息
		return {
			//获取详细数据
			product_detail: function(act_id, goods_id,product_id,callback) {
				Http.post({
					method: 'marketing.giving.detail',
					act_id: act_id,
					goods_id:goods_id,
					product_id:product_id
				}, function(result) {
					if(callback)
						callback(result,result.process_time);
				}, function(e) {

				}, function() {

				})
			},
			get_paper:function(qsid,callback){
				Http.post({
					method:'marketing.giving.get_paper',
					qsid:qsid
				},function(result){
					if(callback)
					callback(result);
				})
			},
			upload:function(file,file_name,callback){
				Http.post({
					method:'marketing.giving.upload',
					file:file,
					file_name:file_name
				},function(data){
					if(callback)
					callback(data.result);
				})
			},
			send_apply:function(act_id,file_id,file_name,asked,callback){
				Http.post({
					method:'marketing.giving.send_apply',
					act_id:act_id,
					file_id:file_id,
					file_name:file_name,
					asked:asked
				},function(data){
					if(callback)
					callback(data);
				})
			},
			//客服列表
			//客服QQ与联系方式
			contact_show: function(store_id,callback) {
				Http.post({
					method: 'shop.cusphone.getlist',
					store_id:store_id
				}, function(result) {
					//函数回调
					if(callback)
						callback(result.result);
				}, function(e) {

				}, function() {

				});
			}
		};
	}

	factory.$inject = ['Http'];
	return app.registerService("NewsendDetail", factory);
});